﻿<UserControl xmlns:my="clr-namespace:EcoProIT.UserControles.View"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:microsoftWindowsThemes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
             xmlns:viewModel="clr-namespace:EcoProIT.UserControles.ViewModel" xmlns:HelpClasses="clr-namespace:HelpClasses;assembly=HelpClasses" mc:Ignorable="d"
             x:Class="EcoProIT.UserControles.View.Resource_Definition" d:DesignHeight="600" d:DesignWidth="533" >
    <UserControl.Resources>
        <HelpClasses:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <my:ProcessImpactDef x:Key="EnvironmentalDef"  />
        <my:NodeDef x:Key="NodeDef" />
        <my:TransportDef x:Key="TransportDef"/>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot"
          RenderTransformOrigin="-0.04,-0.018" d:LayoutOverrides="Width">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="16*"/>
            <ColumnDefinition Width="103*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="60.709" />
            <RowDefinition Height="24.291" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="1" />
                <GradientStop Color="White" Offset="0.703" />
                <GradientStop Color="White" Offset="0.284" />
                <GradientStop Color="White" Offset="0.526" />
                <GradientStop Color="#FF363636" Offset="0.996" />
            </LinearGradientBrush>
        </Grid.Background>
        <Menu Grid.Row="1" Grid.ColumnSpan="2">
            <MenuItem Header="Base" Command="{Binding MenuCommand}"
                      CommandParameter="{Binding Source={StaticResource NodeDef}}"/>
            <MenuItem Header="Transport Base" Command="{Binding MenuCommand}"
        		CommandParameter="{Binding Source={StaticResource TransportDef}}" Visibility="{Binding IsTransport, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            <MenuItem Header="Resource Consumption" Command="{Binding MenuCommand}"
                    CommandParameter="{Binding Source={StaticResource EnvironmentalDef}}" />
        </Menu>
        <Grid MouseLeftButtonUp="ProcessName_MouseDoubleClick_1" Grid.ColumnSpan="2">
            <Label x:Name="ProcessName" MouseLeftButtonUp="ProcessName_MouseDoubleClick_1" Content="{Binding ProcessName}" HorizontalAlignment="Center" VerticalAlignment="Center"
                FontSize="18.667"  />
            <TextBox  Height="26" MinWidth="200" Text="{Binding ProcessName, UpdateSourceTrigger=PropertyChanged}"  x:Name ="ChangeName" Width="221" Visibility="Collapsed" KeyDown="UserControl_KeyDown_1" Margin="163,10,0,0" RenderTransformOrigin="0.495,0.3" VerticalAlignment="Top" HorizontalAlignment="Left"/>
        </Grid>
        <UserControl Grid.Row="2" Content="{Binding SelectedView}" Grid.ColumnSpan="2"  />
        <Button Content="OK" Grid.Column="1" Margin="0,0,110,0" Grid.Row="3" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" Click="OK_Click"/>
        <Button Content="Cancel" Grid.Column="1" Margin="0,0,10,0" Grid.Row="3" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" Click="Cancel_Click_1"/>

    </Grid>
</UserControl>